<!-- 审核状态 -->
<template>
	<view class="content">
		<!-- 审核中和未审核 -->
		<!-- #ifdef APP-PLUS -->
		<view :class="['bg', status == 1 ? 'pass' : '']">
			<u-icon name="arrow-left" color="#000" size="38" @click="back"></u-icon>
			<text>创作中心</text>
			<u-icon name="question-circle-fill" color="#53a3ff" size="40" @click="prompt"></u-icon>
		</view>
		<!-- #endif -->
		<!-- #ifdef MP-WEIXIN -->
		<view class="flex_end header_r" :class="['bg', status == 1 ? 'pass' : '']">
			<u-icon name="question-circle-fill" color="#53a3ff" size="40" @click="prompt"></u-icon></view>
		<!-- #endif -->
		<block v-if="info.id">
			<!-- 审核中 -->
			<view v-if="status == 0"><review-box :info="info" @know="know"></review-box></view>
			<!-- 审核通过 -->
			<view v-if="status == 1"><audit-pass @detail="detail" @goMyUpload="goMyUpload"></audit-pass></view>

			<!-- 审核未通过 -->
			<view v-if="status == 2"><not-pass :info="info" @resubmit="resubmit"></not-pass></view>
		</block>
		<!-- 提示弹窗 -->
		<prompt-popup :show="promptShow" @close="close" :content="content"></prompt-popup>
	</view>
</template>

<script>
import { lecturerInStatus, getCopywriting } from '@/apis/apis.js';
import promptPopup from '@/pages/mine/modules/promptPopup.vue';
import reviewBox from '@/pages/mine/modules/reviews.vue';
import notPass from '@/pages/mine/modules/notPass.vue';
import auditPass from '@/pages/mine/modules/auditPass.vue';
export default {
	components: {
		promptPopup,
		reviewBox,
		notPass,
		auditPass
	},
	data() {
		return {
			//审核状态（0：待审核，1：已通过，2：已驳回） 讲师审核
			promptShow: false,
			info: {},
			status: 2,
			content: '' //创作中心文案
		};
	},
	onShow() {
		this.init();
	},
	methods: {
		init() {
			lecturerInStatus().then(res => {
				// console.log(res)
				if (!res.data) {
					uni.redirectTo({
						url: './center'
					});
				} else {
					this.info = res.data;
					this.status = res.data.exStatus;
				}
			});
			let type = 4;
			getCopywriting(type).then(res => {
				this.content = res.data.content;
			});
		},
		goMyUpload() {
			uni.navigateTo({
				url: `/pages/mine/views/create/myUpload?lecturerId=${this.info.id}`
			});
		},
		back() {
			uni.navigateBack();
		},
		prompt() {
			this.promptShow = true;
		},
		close() {
			this.promptShow = false;
		},
		//审核中组件的我知道了事件
		know() {
			console.log('我知道了');
			uni.navigateBack();
		},
		//审核未通过组件的重新提交事件
		resubmit() {
			uni.navigateTo({
				url: './center?reset=' + true
			});
			console.log('重新提交');
		},
		//收益明细
		detail() {
			console.log('收益明细');
			uni.navigateTo({
				url: '/pages/mine/views/create/withdrawalRecord'
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.content {
}

.boxBg {
}

.bg {
	width: 100%;
	height: 144rpx;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 76rpx 30rpx 0 32rpx;

	& > text {
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #000000;
	}
}
.header_r{
	position: fixed;
	right: 0;
	top:0;
	padding:10rpx 20rpx;
	width: 100vw;
	box-sizing: border-box;
	justify-content: flex-end;
}
.pass {
	width: 100%;
	height: 696rpx;
	background: url('https://yzxk.oss-cn-hangzhou.aliyuncs.com/images/mine/create/_bg.png') no-repeat;
	background-size: cover;
	align-items: flex-start;
}
</style>
